<template>
  <el-drawer
    :title="$t('message.ddxq')"
    :visible.sync="showOrder"
    size="1000px"
    :wrapper-closable="!modalDialog"
  >
    <div class="property-title">{{ $t('message.ddxq') }}</div>
    <div class="df_ac">
      <div>
        <span class="key">{{ $t('message.ddbh') }}：</span>
        <span class="value">{{ detail.orderId }}</span>
      </div>
      <div>
        <span class="key">{{ $t('message.ddzt') }}：</span>
        <span class="value"> {{ detail.orderStatus }}</span>
      </div>
      <div>
        <span class="key">{{ $t('message.createTime') }}：</span>
        <span class="value">{{ detail.orderTime }}</span>
      </div>
      <div>
        <span class="key">{{ $t('message.ddly') }}：</span>
        <span class="value">{{ detail.fromType == '01'?$t('message.xcx'): $t('message.cgpcd') }}</span>
      </div>
      <div v-if="detail.payTime">
        <span class="key">{{ $t('message.paytime') }}：</span>
        <span class="value">{{ detail.payTime || '~' }}</span>
      </div>
      <div v-if="detail.payMethod">
        <span class="key">{{ $t('message.zffs') }}：</span>
        <span class="value">{{ detail.payMethod || '~' }}</span>
      </div>
      <div v-if="detail.mixedPayMethod" class="item">
        <span class="key">{{ $t('message.hhzffs') }}：</span>
        <span class="value">{{ detail.mixedPayMethod || '-' }}</span>
      </div>
      <div v-if="detail.mixedPayMoney" class="item">
        <span class="key">{{ $t('message.hhzfje') }}：</span>
        <span class="value">{{ detail.mixedPayMoney || '-' }}</span>
      </div>
      <div v-if="detail.cardPayMoney" class="item">
        <span class="key">{{ $t('message.hhzfhykje') }}：</span>
        <span class="value">{{ detail.cardPayMoney || '-' }}</span>
      </div>
      <div v-if="detail.refundPrice || detail.refundPrice === 0">
        <span class="key">{{ $t('message.tkje') }}：</span>
        <span class="value">{{ detail.refundPrice }}</span>
      </div>
      <div>
        <span class="key">{{ $t('message.czy') }}：</span>
        <span class="value">{{ detail.createUser || '~' }}</span>
      </div>
      <div>
        <span class="key">{{ $t('message.bz') }}：</span>
        <span class="value">{{ detail.remake || '~' }}</span>
      </div>
    </div>
    <div class="line-style mb20" />
    <div class="property-title">{{ $t('message.kpqk') }}</div>
    <div class="df_ac">
      <div>
        <span class="key">{{ $t('message.kpzt') }}：</span>
        <span class="value">{{ detail.invoiceStatus== '1'?$t('message.yk'):$t('message.wkq') }}</span>
      </div>
      <div>
        <span class="key">{{ $t('message.kpzt') }}：</span>
        <span class="value">{{ detail.invoiceTime || "~" }}</span>
      </div>
    </div>
    <div class="line-style mb20" />
    <div class="property-title">{{ $t('message.memberInfo') }}</div>
    <div class="df_ac">
      <div>
        <span class="key">{{ $t('message.name') }}：</span>
        <span class="value">{{ detail.memberName }}</span>
      </div>
      <div>
        <span class="key">{{ $t('message.lxdh') }}：</span>
        <span class="value">{{ detail.memberPhone || "~" }}</span>
      </div>
      <div>
        <span class="key">{{ $t('message.hykh') }}：</span>
        <span class="value">{{ detail.memberId || "~" }}</span>
      </div>
    </div>
    <div class="line-style mb20" />
    <div class="property-title">{{ $t('message.spxx') }}</div>
    <el-table
      ref="multipleTable"
      :data="detail.orderDetailList"
      border
      fit
      :header-row-class-name="'table-header'"
      class="doumee-element-table"
    >
      <el-table-column
        align="center"
        :label="$t('message.bykmc')"
        prop="escortName"
        show-overflow-tooltip
        min-width="120"
      />

      <el-table-column
        align="center"
        :label="$t('message.glcp')"
        show-overflow-tooltip
        prop="objName"
        min-width="120"
      />
      <el-table-column
        :label="$t('message.ddje')"
        prop="price"
        min-width="100"
        show-overflow-tooltip
        align="center"
      />
      <el-table-column
        :label="$t('message.hydk')"
        prop="memberPrice"
        show-overflow-tooltip
        min-width="100"
        align="center"
      />
      <el-table-column
        :label="$t('message.tkje')"
        prop="refundPrice"
        show-overflow-tooltip
        min-width="100"
        align="center"
      />
      <el-table-column
        :label="$t('message.status')"
        prop="payStatus"
        show-overflow-tooltip
        min-width="80"
        align="center"
      />
    </el-table>
    <div v-if="detail.detailMoneyRespParam" class="bottom_wrap">
      <div class="line">
        <span>{{ $t('message.ddspje') }}：</span>
        <span v-if="detail.detailMoneyRespParam">{{ detail.detailMoneyRespParam.orderPrice || 0 }}</span>
        <span>{{ $t('message.yuan') }}</span>
      </div>
      <div v-if="detail.detailMoneyRespParam.memberDiscount" class="line">
        <span>{{ detail.payMethod == $t('message.zxkzf')? $t('message.zxkdk') + '：' : $t('message.hydk') + '：' }}</span>
        <span v-if="detail.detailMoneyRespParam.memberDiscount">-</span>
        <span v-if="detail.detailMoneyRespParam">{{ detail.detailMoneyRespParam.memberDiscount || 0 }}</span>
        <span>{{ $t('message.yuan') }}</span>
      </div>
      <div v-if="detail.detailMoneyRespParam.marketingPolicy" class="line">
        <span>{{ $t('message.yxzc') }}：</span>
        <span v-if="detail.detailMoneyRespParam.marketingPolicy">-</span>
        <span v-if="detail.detailMoneyRespParam">{{ detail.detailMoneyRespParam.marketingPolicy || 0 }}</span>
        <span>{{ $t('message.yuan') }}</span>
      </div>
      <div v-if="detail.detailMoneyRespParam.groupBuyCoupon" class="line">
        <span>{{ $t('message.tgj') }}：</span>
        <span v-if="detail.detailMoneyRespParam.groupBuyCoupon">-</span>
        <span v-if="detail.detailMoneyRespParam">{{ detail.detailMoneyRespParam.groupBuyCoupon || 0 }}</span>
        <span>{{ $t('message.yuan') }}</span>
      </div>
      <div v-if="detail.detailMoneyRespParam.discountCoupon" class="line">
        <span>{{ $t('message.yhj') }}：</span>
        <span v-if="detail.detailMoneyRespParam.discountCoupon">-</span>
        <span v-if="detail.detailMoneyRespParam">{{ detail.detailMoneyRespParam.discountCoupon || 0 }}</span>
        <span>{{ $t('message.yuan') }}</span>
      </div>
      <div v-if="detail.detailMoneyRespParam.integral" class="line">
        <span>{{ $t('message.jfdk') }}：</span>
        <span v-if="detail.detailMoneyRespParam.integral">-</span>
        <span v-if="detail.detailMoneyRespParam">{{ detail.detailMoneyRespParam.integral || 0 }}</span>
        <span>{{ $t('message.yuan') }}</span>
      </div>
      <div v-if="detail.detailMoneyRespParam.getPrice || detail.detailMoneyRespParam.getPrice === 0" class="line secondColor">
        <span>{{ $t('message.shk') }}：</span>
        <span v-if="detail.detailMoneyRespParam">{{ detail.detailMoneyRespParam.getPrice || 0 }} </span>
        <span>{{ $t('message.yuan') }}{{ detail.mealsMemberId?'(' + $t('message.ydck') + ')':'' }}</span>
      </div>
    </div>
  </el-drawer>
  <!--</div> -->
</template>

<script>
import { escortOrderDetail } from '@/api'
import store from '@/store'
export default {
  name: 'OrderDetail',
  data() {
    return {
      detail: {},
      modalDialog: store.getters.dialog,
      showOrder: false // 弹窗
    }
  },
  methods: {
    goBack() {
      this.$router.replace('/ticket/ticketOrder')
    },
    getOrderDetail(orderId) {
      escortOrderDetail({ param: { orderId }}).then((res) => {
        if (res.errorCode === '000000') {
          this.showOrder = true
          this.detail = res.record
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>

.df_ac {
  flex-wrap: wrap;
  div {
    width: 33.33%;
    margin-bottom: 20px;
    .key {
  color: #666666;
  display: inline-block;
  // width: 90px;
  // text-align: right;
}
.value {
  color: #222;
}
  }
}
.bottom_wrap {
  margin-top: 30px;
  text-align: right;
  .line {
    margin-bottom: 10px;
  }
}
</style>
